package com.mioto.ld.module.statistics.model;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author mioto-qinxj
 * @date 2024/6/18
 * @desc
 */
@Getter
@Setter
public class AppStatisticSearchDTO extends DeviceSaleSearchDTO{

    @ApiModelProperty(value = "统计结束时间",hidden = true)
    private Date endDate;
    @ApiModelProperty(value = "今日统计开始时间",hidden = true)
    private Date todayStartDate;
    @ApiModelProperty(value = "本周统计开始时间",hidden = true)
    private Date weekStartDate;
    @ApiModelProperty(value = "本月统计开始时间",hidden = true)
    private Date monthStartDate;

    public AppStatisticSearchDTO(){
        endDate = new Date();
        todayStartDate = DateUtil.beginOfDay(endDate);
        weekStartDate = DateUtil.beginOfDay(DateUtil.offsetDay(endDate,-6));
        monthStartDate = DateUtil.beginOfDay(DateUtil.offsetDay(endDate,-29));
    }
}
